package com.haibara.aiojfeignclient.client;

import com.haibara.aiojmodel.model.entity.Question;
import com.haibara.aiojmodel.model.entity.QuestionSubmit;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "question-service", path = "/api/question/feign")
public interface QuestionClient {

    @GetMapping("/getQuestionById")
    Question getQuestionById(@RequestParam("questionId") Long questionId);

    @PostMapping("/updateQuestion")
    boolean updateQuestion(@RequestBody Question question);

    @GetMapping("/getQuestionSubmitById")
    QuestionSubmit getQuestionSubmitById(@RequestParam("questionSubmitId") Long questionSubmitId);

    @PostMapping("/updateQuestionSubmit")
    boolean updateQuestionSubmit(@RequestBody QuestionSubmit questionSubmit);
}
